Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC: add weights keyword to density; close #201 #232

Merged
merged 1 commit into from
May 27, 2019

Conversation

mkborregaard
Copy link
Member

@mkborregaard mkborregaard commented May 27, 2019

With

using StatsBase, StatPlots
plot(
       density(1:3), # Fine
       density(1:3, weights = weights([0,500,1])), # No change
       density(1:3, weights = [0,500,1]), # No change
       density(vcat(1, ones(500), 2)), # Correct
       density(1:3, weights([0,500,1])), # Not sure what this is
legend = false) 

changes
skaermbillede 2018-11-26 kl 08 57 40
to
Skærmbillede 2019-05-27 kl  19 38 13

cc @cossio @Nosferican

@cossio
Copy link

cossio commented May 27, 2019

What does density(1:3, weights([0,500,1])) do?

@mkborregaard
Copy link
Member Author

The same as density([0,500,1]) - which is consistent with the Plots logic, though not the StatsBase one. I think we should leave this as is, and stay consistent with requiring a keyword.
If you're both happy with the current implementation I'll merge and tag a new version.

@cossio
Copy link

cossio commented May 27, 2019

Looks good. Thanks!

@mkborregaard mkborregaard merged commit 8b75e18 into master May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants